﻿/*            Copyright(c) 2006-2008 Dave Sexton           *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;

namespace DaveSexton.DocProject
{
	internal sealed class DependencyLoader : AssemblyLoader
	{
		#region Public Properties
		#endregion

		#region Private / Protected
		private readonly string assemblyPath;
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="DependencyLoader" /> class.
		/// </summary>
		public DependencyLoader(string assemblyPath)
		{
			if (string.IsNullOrEmpty(assemblyPath))
				throw new ArgumentException(Resources.Errors.NullOrEmpty, "assemblyPath");

			this.assemblyPath = assemblyPath;

			AttachToCurrentAppDomain(true);
		}
		#endregion

		#region Methods
		protected override System.Reflection.AssemblyName CreateAssemblyName()
		{
			return System.Reflection.AssemblyName.GetAssemblyName(assemblyPath);
		}
		#endregion
	}
}
